<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.saturn.auth.User"%>
<%@page import="com.saturn.sldb.Emergency"%>
<%@page import="com.saturn.app.utils.DateUtils"%>
<%@page import="com.saturn.auth.Organization"%>
<%@page import="java.util.*"%>
	<%
	User user = (User)session.getAttribute("authUser");
	String userId = user.getId();
	Organization organizationUser = Organization.getOneOrganizationByUser(userId);
	String name = organizationUser.getName();
	List organizations = Organization.getOrganizationByUser(user.getId());
	String department = "";
	if (organizations != null && !organizations.isEmpty()) {
		department = ((Organization)organizations.get(0)).getName();
	}
	%>	
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加紧急救助低保</title>
<%@ include file="/app/includes/header.jsp"%>
<style type="text/css">
<!--
.STYLE1 {
	font-size: 24px;
	font-weight: bold;
}
-->
	input {border:none;}
	.table_1{border-right:1px solid black; border-top:1px solid black}
	.table_1 td{border-left:1px solid black; border-bottom:1px solid black;}
	body{font-size:12px;}
</style>
<script> 
$(function() {
	/* $('#marry').focus();
	$('#marry').combobox({
		value : '${society.marry }',
		onSelect:function(record){
			$('#marry').val(record.text);
	    }
	});
	
	$('#labor').combobox({
		value : '${society.labor }',
		onSelect:function(record){
			$('#labor').val(record.text);
	    }
	});
	
	$('#familyClass').combobox({
		value : '${society.familyClass }',
		onSelect:function(record){
			$('#familyClass').val(record.text);
	    }
	});
	
	$('#accountType').combobox({
		value : '${society.accountType }',
		onSelect:function(record){
			$('#accountType').val(record.text);
	    }
	}); */
	//同户人信息1
	$('#c_relation0').combobox({
		value : '${subs[0].personRelation}',
		onSelect:function(record){
			$('#c_relation0').val(record.text);
	    }
	});
	
	//同户人信息2
	$('#c_relation1').combobox({
		value : '${subs[1].personRelation}',
		onSelect:function(record){
			$('#c_relation1').val(record.text);
	    }
	});
	
	//同户人信息3
	$('#c_relation2').combobox({
		value : '${subs[2].personRelation}',
		onSelect:function(record){
			$('#c_relation2').val(record.text);
	    }
	});
	
	//同户人信息4
	$('#c_relation3').combobox({
		value : '${subs[3].personRelation}',
		onSelect:function(record){
			$('#c_relation3').val(record.text);
	    }
	});
	
	//同户人信息5
	$('#c_relation4').combobox({
		value : '${subs[4].personRelation}',
		onSelect:function(record){
			$('#c_relation4').val(record.text);
	    }
	});
	
});
</script>
<!-- 显示附件图片 -->
<script type="text/javascript">
function showPhoto(){
	var p = '${emergency.files}';
	var str= new Array();   
	str=p.split(";"); 
	var files = $("#files").html();
	for (i=0;i<str.length ;i++ )   
	{   
		if(str[i]!=null&&str[i]!="")
		files+="<a href=\""+str[i]+"\" target=\"_blank\"><img src=\""+str[i]+"\" width=100px; height=100px;/></a>&nbsp;";
	}   
	$("#files").html(files);
}
$(function() {
	showPhoto();
});
</script>
<!-- START JS为radio赋值 -->
<script language="javascript" type="text/javascript">
	$(document).ready(function() {
		var rescueCategoryVO = "${emergency.rescueCategory}";
		
		if(document.getElementById("jinan").value == rescueCategoryVO){
			$("input[name='rescueCategory']").attr("checked",true);
		} else if(document.getElementById("zhichu").value == rescueCategoryVO){
			$("input[id='zhichu']").attr("checked",true);
		} else if(document.getElementById("kunjing").value == rescueCategoryVO){
			$("input[id='kunjing']").attr("checked",true);
		} else if(document.getElementById("qita").value == rescueCategoryVO){
			$("input[id='qita']").attr("checked",true);
		}
		//救助类型
		var peopleTypeVO = "${emergency.peopleType}";
		if(document.getElementById("geren").value == peopleTypeVO){
			$("input[id='geren']").attr("checked",true);
		} else if(document.getElementById("jiating").value == peopleTypeVO){
			$("input[id='jiating']").attr("checked",true);
		}

		//城镇类型
		var accountTypeVO = "${emergency.accountType}";
		if(document.getElementById("nongchun").value == accountTypeVO){
			$("input[id='nongchun']").attr("checked",true);
		} else if(document.getElementById("chengshi").value == accountTypeVO){
			$("input[id='chengshi']").attr("checked",true);
		}
		
		//户籍属地
		var registrationVO = "${emergency.registration}";
		if(document.getElementById("bendi").value == registrationVO){
			$("input[id='bendi']").attr("checked",true);
		} else if(document.getElementById("feibendi").value == registrationVO){
			$("input[id='feibendi']").attr("checked",true);
		}
		
		//救助方式
		var safeWayVO = "${emergency.safeWay}";
		if(document.getElementById("dibao").value == safeWayVO){
			$("input[id='dibao']").attr("checked",true);
		} else if(document.getElementById("feidibao").value == safeWayVO){
			$("input[id='feidibao']").attr("checked",true);
		}
		//审批情况
		var approveTypeVO = "${emergency.approveType}";
		if(document.getElementById("spjy").value == approveTypeVO){
			$("input[id='spjy']").attr("checked",true);
		} else if(document.getElementById("xesp").value == approveTypeVO){
			$("input[id='xesp']").attr("checked",true);
		}
		//申请事由
		var applyCauseVO = "${emergency.applyCause}";
		if(document.getElementById("hz").value == applyCauseVO){
			$("input[id='hz']").attr("checked",true);
		} else if(document.getElementById("jt").value == applyCauseVO){
			$("input[id='jt']").attr("checked",true);
		}else if(document.getElementById("tf").value == applyCauseVO){
			$("input[id='tf']").attr("checked",true);
		}else if(document.getElementById("kj").value == applyCauseVO){
			$("input[id='kj']").attr("checked",true);
		}else if(document.getElementById("zc").value == applyCauseVO){
			$("input[id='zc']").attr("checked",true);
		}else if(document.getElementById("qt").value == applyCauseVO){
			$("input[id='qt']").attr("checked",true);
		}
		//救助方式
		var wayVO = "${emergency.way}";
		if(document.getElementById("shehuihua").value == wayVO){
			$("input[id='shehuihua']").attr("checked",true);
		} else if(document.getElementById("xianjin").value == wayVO){
			$("input[id='xianjin']").attr("checked",true);
		};
		
		//紧急程度
		var typeVO = "${emergency.type}";
		if(document.getElementById("ybjz").value == typeVO){
			$("input[id='ybjz']").attr("checked",true);
		} else if(document.getElementById("jjjz").value == typeVO){
			$("input[id='jjjz']").attr("checked",true);
		};
	});
</script> 
</head>
<body>
	<form id="addForm" name="addForm" action="<%=request.getContextPath()%>/app/sldb/emergency/apply/updateEmergency.action" method="post">
		<input type="hidden" name="type1" value="auto" />
		<input id="createTime" name="createTime" type="hidden" value="${emergency.createTime}"></input>
			<input id="creater" name="creater" type="hidden" value="${emergency.creater}"></input>
			<input id="createrName" name="createrName" type="hidden" value="${emergency.createrName}"></input>
			<input id="createrDepartment" name="createrDepartment"  type="hidden" value="${emergency.createrDepartment}"></input>
			<input id="state" name="state" type="hidden" value="${emergency.state}"></input>
			<input id="inputType" name="inputType" type="hidden" value="${emergency.inputType}"></input>
			<input id="homeNumber" name="homeNumber" type="hidden" value="${emergency.homeNumber}"></input>
			<%-- <input id="type" name="type" type="hidden" value="${emergency.type}"></input> --%>
			<input type="hidden" id="id" name="id" value="${emergency.id}" />
			<input type="hidden" id="remarks" name="remarks" value="${emergency.remarks}" />
		<OBJECT classid="clsid:10946843-7507-44FE-ACE8-2B3483D179B7"
			id="CVR_IDCard" name="CVR_IDCard" width="0" height="0"> </OBJECT>
		<a href="#" onclick="javascript:history.back(-1)" class="easyui-linkbutton">返  回</a>
		<p>
<center>
<label style="font-size:24px">临时救助申请人基本情况登记表</label>
<br> 
<br>
<div style="float: right;width:50%">(录入方式：${emergency.inputType})</div>
<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_1">
  <tr>
    <td height="50" colspan="7" align="left">救助类别：
    	<input name="rescueCategory" id="jinan" type="radio" checked="checked" value="急难型" readonly="readonly"readonly="readonly"/>急难型&nbsp;
    	<input name="rescueCategory" id="zhichu" type="radio" value="支出型"readonly="readonly"/> 支出型 &nbsp;
    	<input name="rescueCategory" id="kunjing" type="radio" value="困境低保" readonly="readonly"/>困境低保&nbsp;
    	<input name="rescueCategory" id="qita" type="radio" value="其他" readonly="readonly"/>其他<br>
    	紧急程度：&nbsp;<input name="type" type="radio" id="ybjz" checked="checked" value="一般救助"readonly="readonly"/>一般救助&nbsp;<input name="type" id="jjjz" type="radio" value="紧急救助"readonly="readonly"/>紧急救助<span style="float:right;margin:-20px 0px 0px 0px;">
    	编号： <input type="text" id="numberNO" name="numberNO" value="${emergency.numberNO}" style="border-top-style:none;border-left-style:none;border-right-style:none;border-bottom-style:none;"readonly="readonly"/></span>
    </td>
  </tr>
  <tr>
    <td height="20" colspan="7" bgcolor="#BFBFBF" align="left"><strong>申请人基本情况：</strong></td>
    </tr>
  <tr>
    <td width="104" height="37"><div align="center">户主或本人姓名</div></td>
    <td width="116"><input id="name" type="text" name="name" size="9" value="${emergency.name}"readonly="readonly"/></td>
    <td width="111"><div align="center">性别</div></td>
    <td width="73"><input id="sex" type="text" name="sex" size="9" value="${emergency.sex}"readonly="readonly"/></td>
    <td width="69"><div align="center">家庭人口</div></td>
    <td width="66"><input id="home" type="text" name="home" size="9" value="${emergency.home}"readonly="readonly"/></td>
    <td rowspan="4" colspan="2" align="center"> <img src="data:image/jpg;base64,${emergency.photo }" style="width: 80px; height: 90px" id="picture" name="picture" /></td>
    </tr>
  <tr>
    <td height="33">
      <p>公民身份证号</p>
    </td>
    <td colspan="5" align="left"><input id="identify" type="text" name="identify" size="18" value="${emergency.identify}"readonly="readonly"/></td>
    </tr>
  
  <tr>
    <td height="50"><div align="center">对象类别</div></td>
    <td colspan="5" align="left">
      <span class="STYLE2"><input type="radio" name="peopleType" id="geren" value="个人对象" readonly="readonly"/>个人对象&nbsp;&nbsp;<input type="radio" name="registration" id="bendi" value="本地户籍" readonly="readonly"/>本地户籍&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" id="nongchun" name="accountType"  value="农村居民" readonly="readonly"/>农村居民&nbsp;&nbsp;<input type="radio" id="dibao" name="safeWay" value="低保对象" readonly="readonly"/>低保对象</span><br>
      <span class="STYLE2"><input type="radio" id="jiating" name="peopleType" value="家庭对象" readonly="readonly"/>家庭对象&nbsp;&nbsp;<input type="radio" id="feibendi" name="registration" value="非本地户籍" readonly="readonly"/>非本地户籍 &nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" id="chengshi" name="accountType" value="城市居民" readonly="readonly"/>城市居民&nbsp;&nbsp;<input type="radio" name="safeWay" id="feidibao" value="非低保对象" readonly="readonly"/>非低保对象</span></td>
    </tr>
  
  <tr>
    <td height="20" colspan="7" bgcolor="#BFBFBF" align="left"><strong>共同生活家庭成员情况：</strong></td>
    </tr>
  <tr>
    <td height="33"><div align="center">姓名</div></td>
    <td><div align="center">性别</div></td>
    <td><div align="center">与户主关系</div></td>
    <td colspan="3"><div align="center">公民身份证号</div></td>
    <td width="85"><div align="center">联系电话</div></td>
  </tr>
  <tr>
    <td height="20"><input id="c_name0" type="text" name="c_name" size="8"  value="${subs[0].name}"readonly="readonly"/></td>
    <td><input id="c_sex0" type="text" name="c_sex" size="8"  value="${subs[0].sex}"readonly="readonly"/></td>
    <td><input id="c_personRelation0" type="text" name="c_personRelation" size="8"  value="${subs[0].personRelation}" readonly="readonly" /></td>
    <td colspan="3"><input id="c_identify0" type="text" name="c_identify" size="18"  value="${subs[0].identify}"readonly="readonly"/></td>
    <td><input id="c_contact0" type="text" name="c_contact" size="11"  value="${subs[0].contact}"readonly="readonly"/></td>
  </tr>
  <tr>
    <td height="20"><input id="c_name1" type="text" name="c_name" size="8" value="${subs[1].name}"readonly="readonly"/></td>
    <td><input id="c_sex1" type="text" name="c_sex" size="8" value="${subs[1].sex}"readonly="readonly"/></td>
    <td><input id="c_personRelation1" type="text" name="c_personRelation" size="8"  value="${subs[1].personRelation}" readonly="readonly" /></td>
    <td colspan="3"><input id="c_identify1" type="text" name="c_identify" size="18" value="${subs[1].identify}"readonly="readonly"/></td>
    <td><input id="c_contact1" type="text" name="c_contact" size="11" value="${subs[1].contact}"readonly="readonly"/></td>
  </tr>
  <tr>
    <td height="20"><input id="c_name2" type="text" name="c_name" size="8" value="${subs[2].name}"readonly="readonly"/></td>
    <td><input id="c_sex2" type="text" name="c_sex" size="8" value="${subs[2].sex}"readonly="readonly"/></td>
    <td><input id="c_personRelation2" type="text" name="c_personRelation" size="8"  value="${subs[2].personRelation}" readonly="readonly" /></td>
    <td colspan="3"><input id="c_identify2" type="text" name="c_identify" size="18" value="${subs[2].identify}"readonly="readonly"/></td>
    <td><input id="c_contact2" type="text" name="c_contact" size="11" value="${subs[2].contact}"readonly="readonly"/></td>
  </tr>
  <tr>
    <td height="20"><input id="c_name3" type="text" name="c_name" size="8" value="${subs[3].name}"readonly="readonly"/></td>
    <td><input id="c_sex3" type="text" name="c_sex" size="8" value="${subs[3].sex}"readonly="readonly"/></td>
    <td><input id="c_personRelation3" type="text" name="c_personRelation" size="8"  value="${subs[3].personRelation}" readonly="readonly" /></td>
    <td colspan="3"><input id="c_identify3" type="text" name="c_identify" size="18" value="${subs[3].identify}"readonly="readonly"/></td>
    <td><input id="c_contact3" type="text" name="c_contact" size="11" value="${subs[3].contact}"readonly="readonly"/></td>
  </tr>
  <tr>
    <td height="20"><input id="c_name4" type="text" name="c_name" size="8" value="${subs[4].name}"readonly="readonly"/></td>
    <td><input id="c_sex4" type="text" name="c_sex" size="8" value="${subs[4].sex}"readonly="readonly"/></td>
    <td><input id="c_personRelation4" type="text" name="c_personRelation" size="8"  value="${subs[4].personRelation}" readonly="readonly" /></td>
    <td colspan="3"><input id="c_identify4" type="text" name="c_identify" size="18" value="${subs[4].identify}"readonly="readonly"/></td>
    <td><input id="c_contact4" type="text" name="c_contact" size="11" value="${subs[4].contact}"readonly="readonly"/></td>
  </tr>
  <tr>
    <td height="28"><div align="center">审批人</div></td>
    <td colspan="3"><input id="audit" type="text" name="audit" size="11" value="${emergency.audit}"readonly="readonly"/></td>
    <td colspan="2"><div align="center">审批金额</div></td>
    <td><input id="money" type="text" name="money" size="11" value="${emergency.money}"readonly="readonly"/></td>
  </tr>
  <tr>
    <td height="55"><div align="center">申请事由</div></td>
    <td height="55" colspan="7" align="left">
    	<span class="STYLE2">
    		<input type="radio" id="hz" name="applyCause" checked="checked" value="火灾" readonly="readonly"/>火灾
    		&nbsp;<input id="jt" type="radio" name="applyCause" value="交通事故" readonly="readonly"/>交通事故
    		&nbsp;<input id="tf" type="radio" name="applyCause"  value="突发重大疾病" readonly="readonly"/>突发重大疾病
    		&nbsp;<input id="kj" type="radio" name="applyCause" value="困境低保" readonly="readonly"/>困境低保
    		&nbsp;<input id="zc" type="radio" name="applyCause" value="支出型困难" readonly="readonly"/>支出型困难
    		&nbsp;<input id="qt" type="radio" name="applyCause" value="其他特殊困难" readonly="readonly"/>其他特殊困难
    		<br><br>
    		&nbsp;病种描述：<input type="text" name="causeDesc" id="causeDesc" size="60" value="${emergency.causeDesc}" style="border-bottom: 1px solid;"readonly="readonly"/>
    	</span>
    </td>
  </tr>
  <tr>
    <td height="20" colspan="7" bgcolor="#CCCCCC" align="left"><strong>审批情况：<span style="float:right;margin-right:20px;"><input name="approveType" type="radio" id="spjy" value="审批建议"readonly="readonly"/>审批建议&nbsp;<input name="approveType" id="xesp" type="radio" value="小额审批"readonly="readonly"/>小额审批</span></strong></td>
    </tr>
  
  <tr>
    <td height="34"><div align="center">救助标准</div></td>
    <td height="34" colspan="6" align="left">救助人口：<input id="people" type="text" name="people" size="8" style="border-bottom: 1px solid;" value="${emergency.people}"readonly="readonly"/>人  救助月数：<input id="month" type="text" name="month" size="8" style="border-bottom: 1px solid;" value="${emergency.month}"readonly="readonly"/>月  使用低保标准：<input id="standard" type="text" name="standard" size="8" style="border-bottom: 1px solid;" value="${emergency.standard}"readonly="readonly"/>元/月</td>
  </tr>
  <tr>
    <td height="29"><div align="center">救助方式</div></td>
    <td height="29" colspan="6" align="left">
    	<span class="STYLE2">
    		<input type="radio" id="shehuihua" name="way" checked="checked" value="社会化发放" readonly="readonly"/>社会化发放
    		&nbsp;<input type="radio" id="xianjin" name="way" value="发放现金" readonly="readonly"/>发放现金
    	</span>
    </td>
  </tr>
  <tr>
    <td height="20" colspan="7" bgcolor="#BFBFBF" align="left"><strong>附件：</strong></td>
    </tr>
  <tr>
    <td height="99" colspan="7">&nbsp;<div align="left"  id="files"></div></td>
    </tr>
</table>
</center>
<input type="hidden" id="photo" name="photo" value="${emergency.photo }"/>
</form>
</body>
</html>
